@function val($key) {
  @return map-get($map: $root, $key: $key)
}

$global-fz: .16rem;

$global-color-types:gray, light-gray, danger, primary, orange;

$global-zlevel: 100,200,300,400,500,600,700,800,900;

$root: (
  --color-gray: #949494,
  --color-light-gray: #f4f4f4,
  --color-danger: #FF3333,
  --color-primary: #494FF5,
  --color-orange: #FF7033,
  --color-gray-400: #D9D9D9,
  --color-gray-500: #EBEBEB,
);

@each $v in $global-color-types {
  $key: "--text-color-" + $v;
  $value: val("--color-" + $v);
  $root: map-merge($root, ( #{$key}: #{$value}))
}

@each $v in $global-color-types {
  $key: "--bg-color-" + $v;
  $value: val("--color-" + $v);
  $root: map-merge($root, ( #{$key}: #{$value}))
}

//@each $v in $global-zlevel {
//  .text-sz-#{"" + $v} {
//    font-size: .12rem + (.02rem * ($v / 100 - 1));
//  }
//}

:root {
  @each $k,$v in $root {
    #{$k}: #{$v};
  }
}

